<?php
require('config.php');
		//禁用错误报告
		error_reporting(0);
		//报告运行时错误
		error_reporting(E_ERROR | E_WARNING | E_PARSE);
		//报告所有错误
		error_reporting(E_ALL);
		$time=date('Y-m-d');
		$sql="select * from `".$oto."_ads` where `adPositionId`='-4' and `adStartDate`<='$time' and `adEndDate`>='$time'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$ads[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($ads))
		{
			for($i=0;$i<count($ads);$i++)
			{
				if(isset($ads[$i]['adURLApp']) && $ads[$i]['adURLApp']!=null || $ads[$i]['adURLApp']!="")
				{
					$adURLAPP=explode('|',$ads[$i]['adURLApp']);
					$ads[$i]['adURLApp_type']=$adURLAPP[0];
					$ads[$i]['adURLApp_id']=$adURLAPP[1];
				}
				else
				{
					$ads[$i]['adURLApp_type']='0';
					$ads[$i]['adURLApp_id']='0';
				}
				$aa=@getimagesize($WEB_PATH.'/'.$ads[$i]['adFile']);
				$ads[$i]['width']=$aa["0"];////获取图片的宽
				$ads[$i]['height']=$aa["1"];///获取图片的高
				if($ads[$i]['width']==null) $ads[$i]['width']=0;
				if($ads[$i]['height']==null) $ads[$i]['height']=0;
			}
		}
		echo json_encode($ads);
?>